package vn.co.thn.android.videohot.activity;

import vn.co.thn.android.videohot.R;
import vn.co.thn.android.videohot.VHConstants;
import vn.co.thn.android.videohot.common.VHCommonActivity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;

public class VHSearchActivity extends VHCommonActivity {
	private EditText et_keyword;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.vh_search_activity);
		findViewById(R.id.btn_search).setOnClickListener(this);
		findViewById(R.id.button_close).setOnClickListener(this);
		et_keyword=(EditText)findViewById(R.id.et_keyword);
		
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.btn_search:
			if(!TextUtils.isEmpty(et_keyword.getText().toString())){
				Intent intent=new Intent();
				intent.putExtra(VHConstants.EXTRA_KEY_WORD, et_keyword.getText().toString());
				setResult(RESULT_OK, intent);
				finish();
				}
			break;
		case R.id.button_close:
			finish();
			break;
		default:
			break;
		}
	}
}
